#ifndef __CONFIG_H
#define	__CONFIG_H

#include "def.h"
#include "type_def.h"
#include "stc32g.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "STC32G_Delay.h"
#include "STC32G_GPIO.h"
#include "sys_tim.h"

//#define MAIN_Fosc		22118400L
//#define MAIN_Fosc		12000000L
//#define MAIN_Fosc		11059200L
//#define MAIN_Fosc		 5529600L
#define MAIN_Fosc		24000000L

#define BOOL        bit   
#define TRUE        1  
#define FALSE       0       
typedef enum
{
    false,
    true,
} bool_t;

#define DEBUG        1
#include <stdio.h>

/* 兼容不同编译器的函数名宏 */
#ifndef __func__
    #ifdef __FUNCTION__
        #define __func__ __FUNCTION__
    #else
        #define __func__ "unknown"
    #endif
#endif

/* 带调试信息的printf宏 */
#define DBG_PRINT(fmt, ...) \
    printf("[%s:%d:%s] " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__)

#if DEBUG
    #define DEBUG_PRINT(fmt, ...) DBG_PRINT(fmt, ##__VA_ARGS__)
#else
    #define DEBUG_PRINT(fmt, ...) do {} while (0)
#endif

void System_Init(void);
#endif

